package com.czx.controller;

import com.czx.entity.DiscussPost;
import com.czx.entity.MyPage;
import com.czx.service.DiscussPostService;
import com.sun.scenario.effect.impl.sw.java.JSWBlend_SRC_OUTPeer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;


@Controller
public class IndexController {
    @Autowired
    private DiscussPostService dps;

    @RequestMapping("/index")
    public String getIndex(MyPage page, Model model,Integer orderMode) {
        page =dps.disCussPage(page,orderMode);
        System.out.println(page+"====================");
        model.addAttribute("page", page);
        page.setPath("/index");
        return "index";
    }
}
